/*     */ package eos.moe.dragoncore;
/*     */ import com.google.common.collect.Lists;
/*     */ import java.awt.Color;
/*     */ import java.awt.Point;
/*     */ import java.util.ArrayList;
/*     */ import java.util.Collection;
/*     */ import java.util.List;
/*     */ import java.util.Locale;
/*     */ import java.util.Map;
/*     */ import java.util.concurrent.ConcurrentHashMap;
/*     */ import net.minecraft.client.Minecraft;
/*     */ import net.minecraft.client.gui.FontRenderer;
/*     */ import net.minecraft.client.gui.ScaledResolution;
/*     */ import net.minecraft.util.text.ITextComponent;
/*     */ import net.minecraft.util.text.TextComponentString;
/*     */ import org.lwjgl.input.Mouse;
/*     */ import org.yaml.snakeyamla.configuration.ConfigurationSection;
/*     */ import org.yaml.snakeyamla.configuration.file.YamlConfiguration;
/*     */ 
/*     */ public class sk {
/*     */   public static int w;
/*     */   
/*     */   public static Point v() {
/*  24 */     Minecraft a = Minecraft.func_71410_x();
/*  25 */     ScaledResolution scaledResolution = new ScaledResolution(a);
/*  26 */     int i = scaledResolution.func_78326_a();
/*  27 */     int j = scaledResolution.func_78328_b();
/*  28 */     int k = Mouse.getEventX() * i / a.field_71443_c;
/*  29 */     int m = j - Mouse.getEventY() * j / a.field_71440_d - 1;
/*     */     
/*  31 */     return new Point(k, m);
/*     */   }
/*     */   public static int q;
/*     */   public static boolean v(double a, double d1, double d2, double d3, double d4, double d5) {
/*  35 */     return (a >= d2 && d1 >= d3 && a <= d2 + d4 && d1 <= d3 + d5);
/*     */   }
/*     */   
/*     */   public static Color v(String a) {
/*     */     try {
/*  40 */       if (a.length() == 7 || (a.length() == 9 && a.startsWith("#")))
/*     */       {
/*  42 */         List<Integer> list = new ArrayList();
/*     */         
/*  44 */         for (int i = 1; i < a.length(); i += 2) {
/*  45 */           String str = a.substring(i, i + 2);
/*  46 */           list.add(Integer.valueOf(Integer.parseInt(str, 16)));
/*     */         } 
/*  48 */         if (list.size() == 3) {
/*  49 */           return new Color(((Integer)list.get(0)).intValue(), ((Integer)list.get(1)).intValue(), ((Integer)list.get(2)).intValue());
/*     */         }
/*  51 */         return new Color(((Integer)list.get(1)).intValue(), ((Integer)list.get(2)).intValue(), ((Integer)list.get(3)).intValue(), ((Integer)list.get(0)).intValue());
/*     */       }
/*     */     
/*  54 */     } catch (Exception exception) {
/*  55 */       exception.printStackTrace();
/*     */     } 
/*  57 */     return Color.WHITE;
/*     */   }
/*     */   
/*     */   public static int v(Color a) {
/*  61 */     return a.getAlpha() << 24 | a.getRed() << 16 | a.getGreen() << 8 | a.getBlue();
/*     */   }
/*     */   
/*     */   public static double v(double a, double d1, double d2) {
/*  65 */     return Math.min(d2, Math.max(a, d1));
/*     */   }
/*     */ 
/*     */   
/*     */   public static String v(String a, boolean bool) {
/*  70 */     return (!bool && !(Minecraft.func_71410_x()).field_71474_y.field_74344_o) ? TextFormatting.func_110646_a(a) : a;
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*  76 */   public static Map<String, Object> g = new ConcurrentHashMap<>();
/*     */   
/*     */   public static List<String> v(String a, int i, String str1) {
/*  79 */     String str2 = a + "<->" + i + "<->" + str1;
/*  80 */     if (g.containsKey(str2)) {
/*  81 */       return (List<String>)g.get(str2);
/*     */     }
/*     */ 
/*     */ 
/*     */ 
/*     */     
/*  87 */     String str3 = a.replace("羉", "\n");
/*  88 */     List<String> list = new ArrayList();
/*     */     
/*  90 */     for (String str : str3.split("\n")) {
/*  91 */       if (i > 0) {
/*  92 */         while (str.length() > 0) {
/*  93 */           String str4 = af.v(str, str1, i, false);
/*  94 */           if (str4.isEmpty())
/*     */           {
/*  96 */             str4 = str;
/*     */           }
/*  98 */           list.add(str4);
/*  99 */           str = str.substring(str4.length());
/*     */         } 
/*     */       } else {
/* 102 */         list.add(str);
/*     */       } 
/*     */     } 
/*     */     
/* 106 */     if (list.size() >= 2) {
/* 107 */       for (int j = 0; j < list.size() && 
/* 108 */         j + 1 != list.size(); j++) {
/*     */ 
/*     */ 
/*     */         
/* 112 */         String str = list.get(j);
/* 113 */         list.set(j + 1, v(str) + (String)list.get(j + 1));
/*     */       } 
/*     */     }
/*     */ 
/*     */     
/* 118 */     g.put(str2, list);
/* 119 */     return list;
/*     */   }
/*     */ 
/*     */   
/*     */   public static List<ITextComponent> v(ITextComponent a, int i, String str) {
/* 124 */     String str1 = a + "<->" + i + "<->" + str;
/* 125 */     if (g.containsKey(str1)) {
/* 126 */       return (List<ITextComponent>)g.get(str1);
/*     */     }
/*     */ 
/*     */     
/* 130 */     if (i <= 0) {
/* 131 */       i = 9999;
/*     */     }
/*     */ 
/*     */     
/* 135 */     int j = 0;
/* 136 */     TextComponentString textComponentString = new TextComponentString("");
/* 137 */     List<TextComponentString> list = Lists.newArrayList();
/* 138 */     List<ITextComponent> list1 = Lists.newArrayList((Iterable)a);
/* 139 */     for (int k = 0; k < list1.size(); k++) {
/* 140 */       ITextComponent iTextComponent = list1.get(k);
/* 141 */       String str2 = iTextComponent.func_150261_e();
/* 142 */       boolean bool = false;
/*     */       
/* 144 */       if (str2.contains("\n")) {
/* 145 */         int n = str2.indexOf('\n');
/* 146 */         String str5 = str2.substring(n + 1);
/* 147 */         str2 = str2.substring(0, n + 1);
/* 148 */         TextComponentString textComponentString2 = new TextComponentString(str5);
/* 149 */         textComponentString2.func_150255_a(iTextComponent.func_150256_b().func_150232_l());
/* 150 */         list1.add(k + 1, textComponentString2);
/* 151 */         bool = true;
/*     */       } 
/* 153 */       String str4 = v(iTextComponent.func_150256_b().func_150218_j() + str2, false);
/* 154 */       String str3 = str4.endsWith("\n") ? str4.substring(0, str4.length() - 1) : str4;
/*     */ 
/*     */       
/* 157 */       int m = af.v(str3, str, false);
/* 158 */       TextComponentString textComponentString1 = new TextComponentString(str3);
/* 159 */       textComponentString1.func_150255_a(iTextComponent.func_150256_b().func_150232_l());
/*     */ 
/*     */       
/* 162 */       if (j + m > i) {
/*     */ 
/*     */ 
/*     */ 
/*     */         
/* 167 */         boolean bool1 = false;
/*     */         
/* 169 */         String str5 = af.v(str4, str, i - j, false);
/* 170 */         if (str5.isEmpty() && af.v(str4.substring(0, 1), str, false) > i) {
/*     */ 
/*     */           
/* 173 */           str5 = str4.substring(0, 1);
/* 174 */           bool1 = true;
/*     */         } 
/*     */ 
/*     */         
/* 178 */         String str6 = (str5.length() < str4.length()) ? str4.substring(str5.length()) : null;
/* 179 */         if (str6 != null && !str6.isEmpty()) {
/* 180 */           str6 = FontRenderer.func_78282_e(str5) + str6;
/* 181 */           TextComponentString textComponentString2 = new TextComponentString(str6);
/* 182 */           textComponentString2.func_150255_a(iTextComponent.func_150256_b().func_150232_l());
/* 183 */           list1.add(k + 1, textComponentString2);
/*     */         } 
/*     */         
/* 186 */         m = af.v(str5, str, false);
/* 187 */         textComponentString1 = new TextComponentString(str5);
/* 188 */         textComponentString1.func_150255_a(iTextComponent.func_150256_b().func_150232_l());
/* 189 */         bool = true;
/*     */         
/* 191 */         if (bool1) {
/*     */           
/* 193 */           if (af.v(textComponentString.func_150254_d(), str, false) > 0) {
/* 194 */             list.add(textComponentString);
/*     */           }
/* 196 */           textComponentString = new TextComponentString("");
/* 197 */           j = m;
/* 198 */           textComponentString.func_150257_a((ITextComponent)textComponentString1);
/*     */           
/*     */           continue;
/*     */         } 
/*     */       } 
/* 203 */       if (j + m <= i) {
/* 204 */         j += m;
/* 205 */         textComponentString.func_150257_a((ITextComponent)textComponentString1);
/*     */       } else {
/* 207 */         bool = true;
/*     */       } 
/*     */       
/* 210 */       if (bool) {
/* 211 */         list.add(textComponentString);
/* 212 */         j = 0;
/* 213 */         textComponentString = new TextComponentString("");
/*     */       } 
/*     */       continue;
/*     */     } 
/* 217 */     list.add(textComponentString);
/*     */     
/* 219 */     g.put(str1, list);
/* 220 */     return (List)list;
/*     */   }
/*     */   
/*     */   public static void v(Runnable a) {
/* 224 */     Minecraft.func_71410_x().func_152344_a(a);
/*     */   }
/*     */   
/*     */   public static YamlConfiguration v(Collection a) {
/* 228 */     YamlConfiguration yamlConfiguration1 = new YamlConfiguration();
/*     */     
/* 230 */     YamlConfiguration yamlConfiguration2 = new YamlConfiguration();
/* 231 */     for (YamlConfiguration yamlConfiguration : a) {
/* 232 */       for (String str : yamlConfiguration.getKeys(false)) {
/* 233 */         if ("Functions".equals(str)) {
/* 234 */           ConfigurationSection configurationSection = yamlConfiguration.getConfigurationSection("Functions");
/* 235 */           if (configurationSection == null) {
/*     */             break;
/*     */           }
/* 238 */           for (String str1 : configurationSection.getKeys(false)) {
/* 239 */             if (!yamlConfiguration2.contains(str1) && configurationSection.getString(str1) != null)
/* 240 */               yamlConfiguration2.set(str1, configurationSection.getString(str1)); 
/*     */           } 
/*     */           continue;
/*     */         } 
/* 244 */         if (!yamlConfiguration1.contains(str)) {
/* 245 */           yamlConfiguration1.set(str, yamlConfiguration.get(str));
/*     */         }
/*     */       } 
/*     */     } 
/* 249 */     yamlConfiguration1.set("Functions", yamlConfiguration2);
/* 250 */     return yamlConfiguration1;
/*     */   }
/*     */ 
/*     */   
/*     */   public static String v(String a) {
/* 255 */     String str = "";
/*     */     
/* 257 */     for (int i = 0; i < a.length(); i++) {
/* 258 */       char c = a.charAt(i);
/*     */       
/* 260 */       if (c == '§' && i + 1 < a.length()) {
/* 261 */         int j = "0123456789abcdefklmnor".indexOf(String.valueOf(a.charAt(i + 1)).toLowerCase(Locale.ROOT).charAt(0));
/*     */         
/* 263 */         if (j < 16) {
/* 264 */           str = "§" + a.charAt(i + 1);
/* 265 */         } else if (j == 16) {
/* 266 */           str = str + "§k";
/* 267 */         } else if (j == 17) {
/* 268 */           str = str + "§l";
/* 269 */         } else if (j == 18) {
/* 270 */           str = str + "§m";
/* 271 */         } else if (j == 19) {
/* 272 */           str = str + "§n";
/* 273 */         } else if (j == 20) {
/* 274 */           str = str + "§o";
/* 275 */         } else if (j == 21) {
/* 276 */           str = str + "§r";
/*     */         } 
/*     */         
/* 279 */         i++;
/*     */       } 
/*     */     } 
/* 282 */     return str;
/*     */   }
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\sk.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */